<html>
<head><meta charset="utf-8"><title>IsPrefixOf trait worth? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/IsPrefixOf.20trait.20worth.3F.html">IsPrefixOf trait worth?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="156625802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/IsPrefixOf%20trait%20worth%3F/near/156625802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/IsPrefixOf.20trait.20worth.3F.html#156625802">(Jan 22 2019 at 18:15)</a>:</h4>
<p>I was wondering what's the reason of this trait <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/borrow_check/prefixes.rs" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/borrow_check/prefixes.rs">https://github.com/rust-lang/rust/blob/master/src/librustc_mir/borrow_check/prefixes.rs</a></p>



<a name="156625830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/IsPrefixOf%20trait%20worth%3F/near/156625830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/IsPrefixOf.20trait.20worth.3F.html#156625830">(Jan 22 2019 at 18:15)</a>:</h4>
<p>and btw trying out how help stream works :)</p>



<a name="156625858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/IsPrefixOf%20trait%20worth%3F/near/156625858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/IsPrefixOf.20trait.20worth.3F.html#156625858">(Jan 22 2019 at 18:15)</a>:</h4>
<p>I mean, if the <code>other</code> argument is a <code>Place</code> that doesn't seem to worth that much or am I not seeing something?</p>



<a name="156626344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/IsPrefixOf%20trait%20worth%3F/near/156626344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/IsPrefixOf.20trait.20worth.3F.html#156626344">(Jan 22 2019 at 18:22)</a>:</h4>
<p>That link is 404</p>



<a name="156626665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/IsPrefixOf%20trait%20worth%3F/near/156626665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/IsPrefixOf.20trait.20worth.3F.html#156626665">(Jan 22 2019 at 18:25)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> I presume the <code>IsPrefixOf</code> trait is just a way to get to use method notation</p>



<a name="156628248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/IsPrefixOf%20trait%20worth%3F/near/156628248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/IsPrefixOf.20trait.20worth.3F.html#156628248">(Jan 22 2019 at 18:44)</a>:</h4>
<blockquote>
<p>That link is 404</p>
</blockquote>
<p>fixed</p>



<a name="156628297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/IsPrefixOf%20trait%20worth%3F/near/156628297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/IsPrefixOf.20trait.20worth.3F.html#156628297">(Jan 22 2019 at 18:44)</a>:</h4>
<blockquote>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> I presume the <code>IsPrefixOf</code> trait is just a way to get to use method notation</p>
</blockquote>
<p>what do you mean by method notation?</p>



<a name="156636165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/IsPrefixOf%20trait%20worth%3F/near/156636165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/IsPrefixOf.20trait.20worth.3F.html#156636165">(Jan 22 2019 at 20:22)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> I mean writing <code>foo.bar()</code> instead of <code>bar(foo)</code></p>



<a name="156636199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/IsPrefixOf%20trait%20worth%3F/near/156636199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/IsPrefixOf.20trait.20worth.3F.html#156636199">(Jan 22 2019 at 20:23)</a>:</h4>
<p>i.e., since <code>Place</code> is defined in the <code>librustc</code> crate, if we want to add methods to <code>Place</code> from the <code>librustc_mir</code> crate, we need to add them via a trait</p>



<a name="156636216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/IsPrefixOf%20trait%20worth%3F/near/156636216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/IsPrefixOf.20trait.20worth.3F.html#156636216">(Jan 22 2019 at 20:23)</a>:</h4>
<p>ahh, got it</p>



<a name="156636282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/IsPrefixOf%20trait%20worth%3F/near/156636282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/IsPrefixOf.20trait.20worth.3F.html#156636282">(Jan 22 2019 at 20:24)</a>:</h4>
<p>(deleted)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>